import { createCrudApi } from '@/utils/apiFactory';
import request from '@/utils/unirequest';
import type { ISysHrDismissRequestBill, ISysHrDismissRequestBillView, ISysHrDismissRequestBillVm } from './interface';

export default function SysHrDismissRequestBillApi() {
  // 基础CRUD用工厂生成
  const baseCrud = createCrudApi<
    ISysHrDismissRequestBillView,
    ISysHrDismissRequestBillVm,
    ISysHrDismissRequestBill
  >('/api/SysHrDismissRequestBill');

  return {
    ...baseCrud,
    // 额外的特殊接口
    // 审核接口
    async approve(data: ISysHrDismissRequestBillVm): Promise<ISysHrDismissRequestBill> {
      return await request.post('/api/SysHrDismissRequestBill/approve?tag=', data);
    },
  };
}